import 'mood_repository.dart';
import 'impl/mock_mood_repository.dart';
import 'impl/api_mood_repository.dart';

enum RepositoryType { mock, api }

class MoodRepositoryFactory {
  static RepositoryType _currentType = RepositoryType.mock;
  
  static void setRepositoryType(RepositoryType type) {
    _currentType = type;
  }
  
  static RepositoryType get currentType => _currentType;
  
  static MoodRepository create() {
    switch (_currentType) {
      case RepositoryType.mock:
        return MockMoodRepository();
      case RepositoryType.api:
        return ApiMoodRepository();
    }
  }
  
  static bool get isUsingMock => _currentType == RepositoryType.mock;
  static bool get isUsingApi => _currentType == RepositoryType.api;
}